/******************************************************************************/
//	DxChart.h	-	A class for displaying charts within a DX application
//
//	Author:		Russell Klinkerman
//	Created:	01.28.2005
/******************************************************************************/

#ifndef _DXCHART_H_
#define _DXCHART_H_

#include <vector>
using std::vector;

#include "DxImage.h"


struct	tAnchor
{
	int		nId;	// An identifier for this anchor

	float	fX,		// The X,Y offset into a chart background
			fY;

	bool	bSet;	// Flag indicating if this anchor is currently set
};

class	CDxChart
{
	private:

		CDxImage	*	pdxiBackground,	// The image to use for the chart's background
					*	pdxiMarker;		// The image to use as the chart's marker

		vector<tAnchor> vecAnchors;		// The container for the chart's anchors

	public:

		// constructor
		CDxChart();

		// destructor
		~CDxChart();

		/******************************************************************************/
		//	Set	-	Sets all needed information for the chart
		//
		//	In:		_pdxiBG		-	The image to use as the chart's background
		//			_pdxiMarker	-	The image to use as the chart's marker
		/******************************************************************************/
		void	Set(CDxImage * _pdxiBG, CDxImage * _pdxiMarker);

		/******************************************************************************/
		//	AddAnchor	-	Adds a new anchor (location to place marker) to the chart
		//
		//	In:		_nId	-	An id to use to reference the new anchor
		//			_fX		-	The X offset into the source image for the anchor
		//			_fY		-	The Y offset into the source image for the anchor
		/******************************************************************************/
		void	AddAnchor(int _nId, float _fX, float _fY);

		/******************************************************************************/
		//	SetAnchor	-	Makes an existing anchor active
		//
		//	In:		_nId	-	The id of the anchor to make active
		/******************************************************************************/
		void	SetAnchor(int _nId);

		/******************************************************************************/
		//	Draw	-	Draws the chart to the backbuffer
		//
		//	In:		_pMatrix	-	Matrix defining position, scale, and rotation
		//							for drawing
		//
		//			_bSpriteDrawInProgress	-	Indicates if D3D is currently in
		//										the mode for drawing sprites.
		/******************************************************************************/
		void	Draw(D3DXMATRIX	*	_pMatrix, bool _bSpriteDrawInProgress);

};

#endif